package config

import (
	"exchangeapp/global"
	"github.com/go-redis/redis"
)

func initRedis() {
	RedisClient := redis.NewClient(&redis.Options{
		Addr:     AppConfig.Redis.Address,
		DB:       AppConfig.Redis.Database,
		Password: AppConfig.Redis.Password,
	})
	_, err := RedisClient.Ping().Result()
	if err != nil {
		panic(err)
	}
	global.RedisDB = RedisClient
}
